import { type pageInfo } from '@/page/types/base/baseRequestPage'

export interface adInfo {
  /**
   * 父id
   */
  pid: string

  /**
   * 广告名称
   */
  name: string

  /**
   * 编码
   */
  code: string

  /**
   * 描述
   */
  describes: string

  /**
   * 位置
   */
  position: string

  /**
   * 连接地址
   */
  connectUrl: string

  /**
   * 客户端类型
   */
  clientType: string
  /**
   * 可用
   */
  avail: boolean
  /**
   * 推广首图
   */
  imageUrl: string
}
export interface goodsSpecS extends pageInfo {
  name: string
  /**
   * 名称
   */
  position: string
}
export class adClass {
  adS: goodsSpecS = {
    name: '',
    position: '',
    page: 1,
    size: 10,
    total: 0
  }
  adTable = []
  adEdit = {}
  openLabel = false
  adId = ''
  positionList = []
  adParentList = []
  // name code userType
  clientTypeList = [
    {
      value: 'WECHAT',
      label: '微信用户'
    },
    {
      value: 'WEB',
      label: 'web用户'
    },
    {
      value: 'INSIDER',
      label: '内部人员'
    }
  ]
  adRule = {
    name: [
      {
        required: true,
        message: '名称不能为空',
        trigger: 'change'
      }
    ],
    code: [
      {
        required: true,
        message: '编码不能为空',
        trigger: 'change'
      }
    ],
    position: [
      {
        required: true,
        message: '位置不能为空',
        trigger: 'change'
      }
    ],
    connectUrl: [
      {
        required: true,
        message: 'url不能为空',
        trigger: 'change'
      }
    ],
    clientType: [
      {
        required: true,
        message: '客户端不能为空',
        trigger: 'change'
      }
    ]
  }
}
